package org.smr.ministore.micro.client;

import java.util.List;

import org.blade.utils.Pager;
import org.smr.ministore.entities.Role;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value="auth.Role",/*fallback = HystrixClientFallback.class, */fallbackFactory = HystrixRoleClientFactory.class)
public interface FeignRoleMicroServiceClient {

    @RequestMapping(method = RequestMethod.POST, value = "/Role/batchSave")
    int batchSave(@RequestBody List< Role> entities);

    @RequestMapping(method = RequestMethod.PUT, value = "/Role/save")
    public int save(@RequestBody Role entity) ;

    @RequestMapping(method = RequestMethod.PATCH, value = "/Role/updateById")
    public int updateById(@RequestBody Role id);

    @RequestMapping(method = RequestMethod.GET, value = "/Role/queryById/{id}")
    public  Role queryById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.DELETE, value = "/Role/deleteById/{id}")
    public int deleteById(@PathVariable("id")Long id);

    @RequestMapping(method = RequestMethod.POST, value = "/Role/paginate/{pageSize}/{pageNum}")
    public Pager<Role> paginate( @RequestBody Role entity,  @PathVariable("pageSize")Long pageSize,  @PathVariable("pageNum")Long pageNum );
}
